/*
 * EXTI.h
 *
 *  Created on: Aug 1, 2020
 *      Author: Jiarun
 */

#ifndef __USER_EXTI_H
#define __USER_EXTI_H

#ifdef __cplusplus
 extern "C" {
#endif
	 
#include "stm32f1xx_hal.h"
#include "GPIO.h"

class EXIT : public GPIO
{
public:
		EXIT(GPIO_TypeDef* Port, uint16_t Pin, uint32_t Preempt, uint32_t Sub,
					uint32_t Mode = GPIO_MODE_IT_FALLING, uint32_t Pull = GPIO_PULLUP);

		~EXIT();

    void EnableIRQ();
    void DisableIRQ();
private:
    IRQn_Type EXIT_Line;
    IRQn_Type decideEXTI_Line(uint16_t Pin);
};


#ifdef __cplusplus
}
#endif

#endif /* __USER_EXTI_H */
